import Taro , { Component } from '@tarojs/taro';
import { View, Text , Button} from '@tarojs/components';
import UsedCardRecordFunction from '../../../components/vip-card-record-function';
import NavigationBar from '../../../components/navigationBar/index';
import Time from '../../../static/card/icon_time.png';

import './index.scss';

export default class Index extends Component {

  config = {
      navigationBarTitleText: '',
      enablePullDownRefresh: true,
  }

  state = {
    type: 0, // 0 静止状态 1 pulldown 2 reachBottom
    navigationBarHeight: Taro.getStorageSync('navigationBarHeight'),
    viplist:null
  }

  componentWillMount () {
    this.setState({
      viplist: JSON.parse(this.$router.params.viplist),
  })
  }
  componentDidMount () {}
  componentWillReceiveProps (nextProps,nextContext) {}
  componentWillUnmount () {}
  componentDidShow () {}
  componentDidHide () {}
  componentDidCatchError () {}
  componentDidNotFound () {}
  render() {
    return (
      <View className='card' style={`margin-top: ${navigationBarHeight}`}>
                <NavigationBar type="activity" />

        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>卡号：{viplist.card_no}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>会员类型：{viplist.member_type}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>状态：{viplist.status}</View>
        </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>金额：{viplist.money}</View>
        </View>
        <View className="card-line">
            <Image src={Time} alt="" className="icon" />
            <View>区代用户名：{viplist.has_level_two_user.nickname}</View>
          </View>
           <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>省代用户名：{viplist.has_level_one_user.nickname}</View>
        </View>
        <View className="card-line">
            <Image src={Time} alt="" className="icon" />
            <View>会员用户名：{viplist.has_user.nickname}</View>
          </View>
        <View className="card-line">
          <Image src={Time} alt="" className="icon" />
          <View>更新时间时间：{viplist.update_time}</View>
        </View>
    
        {/* {
   
        }
        <View className="card-line" >
          <Image src={Kind} alt="" className="icon" />
          {(!type) && <View>兑换规格：{sku}</View>}
          {(type) && <View>类型：{cardType}</View>}
        </View>
        {
          (type === 6) && <View className="card-line" >
            <Image src={Agengcy} alt="" className="icon" />
            <View>代理：{agency}</View>
          </View>
        } */}
      </View>
  
    );
  }
}
